package de.hsb.ai.devil.agent;


/**
 * PerfectPlayerAgent tries to play perfect (who knew?!)
 */
@SuppressWarnings("serial")
public class PerfectPlayerAgent extends AbstractDevilPlayer {
	
	/**
	 * Creates a {@link PerfectPlayerAgent}.
	 */
	public PerfectPlayerAgent() {
		super("perfect");
	}
	
	/**
	 * Returns the delta for specified {@code total} (number of matches).
	 * @return the optimal value or at least 1
	 */
	@Override
	public int getDelta(int total) {
		int delta = (total + 3) % 4;
		return delta == 0 ? 1 : delta;
	}

}
